#page_box_wide
  %h1.page_title
    = "#{link_to "Home", "/"} > #{link_to "Administrate", "/admins"} > Comments"
  .menu
    = render :partial => "menu"
  %br{:style => "clear:both;"}
  %table
    %tr
      %th ID
      %th Name
      %th Post
      %th Time
      %th
    - for comment in @comments.reverse
      %tr
        %td
          = comment.id
        %td
          - if comment.user
            = link_to comment.user.name, :action => :show_user, :id => comment.user_id
          - else
            =h comment.email
        %td
          = link_to comment.post.title, :action => :show_post, :id => comment.post_id if comment.post
        %td
          = "#{time_ago_in_words(comment.created_at)} ago"
        %td{:align => "right"}
          = link_to image_tag("icons/trash.gif", :alt => "delete"), {:action => :destroy_comment, :id => comment.id}, :confirm => "Are you sure you want to delete this comment?"  
  %br
  = will_paginate @comments 